feat: allow expressions in add-to-list statements#362
Open
hjotha wants to merge 1 commit intomendixlabs:mainfrom
Open
feat: allow expressions in add-to-list statements#362hjotha wants to merge 1 commit intomendixlabs:mainfrom
hjotha wants to merge 1 commit intomendixlabs:mainfrom
Conversation
Studio Pro stores list-add values as expression strings, but MDL only accepted `add $Item to $List` and the AST kept only a bare item variable. Round-tripping a list-add action whose value is an attribute path or function call could therefore lose the original expression shape. The grammar now accepts `add expression to $List`, the visitor stores the parsed expression while keeping the simple-variable compatibility field, and the builder writes the expression value back to the `ChangeListAction`. The existing variable-only form remains supported. Tests cover parser and builder behavior for expression and simple-variable forms. The branch also adds a draft proposal, doctype fixture, quick-reference entry, and skill guidance; `mxcli check` on the fixture plus make build, make lint-go, and make test pass locally.
This was referenced Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allows microflow add-to-list statements to preserve expression-valued add items.
Changes
add $Item to $Listtoadd expression to $List.AddToListStmtwhile preserving the legacy simple-variableItemfield.ChangeListAction.Valueduring rebuild.Validation
go test ./mdl/visitor -run TestAddToListgo test ./mdl/executor -run TestAddToListBuilder./bin/mxcli check mdl-examples/doctype-tests/add_expression_to_list.test.mdlmake buildmake lint-gomake testCloses #361
Part of #352
Part of #332